<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript 代码块</title>
</head>

<body>
    <h1>我的 Web 页面</h1>
    <p id="myPar">我是一个段落。</p>
    <div id="myDiv">我是一个div。</div>
    <p>
        <button type="button" onclick="myFunction()">点击这里</button>
    </p>
    <script>
        function myFunction() {
            document.getElementById("myPar").innerHTML = "你好世界！";
            document.getElementById("myDiv").innerHTML = "你最近怎么样?";
        }
    </script>
    <p>当您点击上面的按钮时，两个元素会改变。</p>
</body>

</html>